package cn.echo.modules.sys.service;

import cn.echo.modules.sys.dao.GuestBookMapper;
import cn.echo.modules.sys.dao.SiteMapper;
import cn.echo.modules.sys.entity.Guest;
import cn.echo.modules.sys.entity.Site;
import cn.echo.modules.sys.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 简约 鑫 on 2017/4/14.
 */
@Service//让service成为组件(对象) 可以装配(注入)
public class GuestService {
    @Autowired
    private GuestBookMapper guestBookMapper;
    public List<Guest> findAll(Guest guest) {
        List<Guest> guestList = guestBookMapper.findAll(new Guest());
     //   session.close();
        return guestList;
    }

    public boolean deleteById(Guest guest) {

        guestBookMapper.deleteByGuest(guest);

        return true;
    }

}